package com.demo.service.impl;

import com.demo.bean.Student;
import com.demo.common.Result;
import com.demo.mapper.MybatisTestMapper;
import com.demo.service.MybatisTestService;
import com.demo.vo.StudentVO;
import com.demo.vo.TeacherVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class MybatisTestServiceImpl implements MybatisTestService {
    @Autowired
    MybatisTestMapper mybatisTestMapper;
    @Override
    public Result getTeacherVO() {
        TeacherVO teacherVO =  mybatisTestMapper.getTeacherVO(1L);
        log.info("teacher:{}",teacherVO);
        return Result.ok().success(teacherVO);
    }

    @Override
    public Result getStudentVO() {
        StudentVO studentVO = mybatisTestMapper.getStudentVO(1L);
        log.info("student:{}",studentVO);
        return  Result.ok().success(studentVO);
    }
}
